home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-05 | 1.4 KB | 61 lines | [TEXT/MPS ] |
- # BuildCommands - show build commands
- #
- # Usage:
- # BuildCommands program [options…] > commands
- #
- # The BuildCommands script writes the build commands for the specified
- # program (or target) to standard output.
- #
- # Make is used to generate the build commands. If file <program>.make
- # exists it is used as the makefile. If not, file MakeFile is used.
- #
- # The options specified are passed directly to Make, and control the
- # generation of the build commands.
- #
- #
- # Copyright Apple Computer, Inc. 1987 - 1990
- # All rights reserved.
- #
- # Modified for dmake by Matthias Neeracher
- #
-
- # Find the program parameter.
-
- Unset program
- For i In {"Parameters"}
- If "{i}" !~ /-≈/
- Set program "{i}"
- Break
- End
- End
- If "{program}" == ""
- Echo "### {0} - Specify a program to build." > Dev:StdErr
- Echo "# Usage - {0} program [options…]" > Dev:StdErr
- Exit 1
- End
-
- # Select the makefile.
-
- Set makefile `(Files -t TEXT "{program}".mk || ∂
- Files -t TEXT "{program}".make || ∂
- Files -t TEXT makefile.mk || ∂
- Files -t TEXT MakeFile || ∂
- Echo '""') ≥ Dev:Null`
- If "{makefile}" == ""
- Echo "### {0} - No makefile exists for {program}." > Dev:StdErr
- Exit 1
- Else if "{makefile}" =~ /≈.mk/
- Set Make "dmake -n"
- if "{1}" == "-e"
- set everything -u
- shift
- end
- Else
- Set Make "Make"
- End
-
- # Run Make.
-
- Echo "# `Date -t` ----- Build commands for {program}."
- {Make} {Everything} {"Parameters"} -f "{makefile}"
-